<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta name="description" content="清镇安监卫士">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>我的举报</title>

    <style type="text/css">
        body, div, p, h1, h2, h3, h4, h5, h6, li, span, label, a {
            font-family: "Arial",
            "Microsoft YaHei", "微软雅黑",
            "SimHei", "黑体",
            "STHeiti", "华文黑体",
            "NSimSun", "新宋体",
            "SimSun", "宋体",
            "sans-serif";
        }
    </style>

    <link rel="stylesheet" href="<%=basePath%>js/lib/ace/components/font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="<%=basePath%>css/lib/iconfont/iconfont.css">
    <link rel="stylesheet" href="<%=basePath%>css/lib/weui/weui.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/common/common.css">
</head>
<body>
<c:choose>
    <c:when test="${(not empty resultVo.results) and (fn:length(resultVo.results) eq 2) and (not empty resultVo.results[1].results)}">
        <input id="openid" type="hidden" value="${resultVo.results[0]}">
        <input id="pages" type="hidden" value="${resultVo.results[1].pages}">
        <input id="prev_page" type="hidden" value="${resultVo.results[1].prevPage}">
        <input id="curr_page" type="hidden" value="${resultVo.results[1].currPage}">
        <input id="next_page" type="hidden" value="${resultVo.results[1].nextPage}">

        <div id="report_list" class="weui-cells">
            <c:forEach var="report" items="${resultVo.results[1].results}">
                <a class="weui-cell weui-cell_access" href="<%=basePath%>weixin/report/detail.html?id=${report.id}">
                    <div class="weui-cell__bd">
                        <p class="f-s-16 text-break">${report.reportName}</p>

                        <p class="c-tint-black p-t-10 f-s-14 text-no-break">${report.reportCreateTime}</p>
                    </div>

                    <div class="weui-cell__ft text-no-break">
                        <c:choose>
                            <c:when test="${report.reportResult eq '1'}">
                                <span class="c-tint-black f-s-14">已举报</span>
                            </c:when>

                            <c:when test="${report.reportResult eq '2'}">
                                <span class="c-blue f-s-14">核实中</span>
                            </c:when>

                            <c:when test="${report.reportResult eq '3'}">
                                <span class="c-yellow f-s-14 ">已核实</span>
                            </c:when>

                            <c:when test="${report.reportResult eq '4'}">
                                <span class="c-red f-s-14">已关闭</span>
                            </c:when>

                            <c:when test="${report.reportResult eq '5'}">
                                <span class="c-green f-s-14">已发放</span>
                            </c:when>
                        </c:choose>
                    </div>
                </a>
            </c:forEach>
        </div>

        <c:choose>
            <c:when test="${resultVo.results[1].pages le 1}">
                <div id="loading" class="align-center f-s-16 height-50 line-height-50">
                    <span class="c-green">
                        <i class="iconfont icon-right"></i>已全部加载完毕
                    </span>
                </div>
            </c:when>

            <c:otherwise>
                <div id="loading" class="align-center f-s-16 height-50 line-height-50"></div>
            </c:otherwise>
        </c:choose>
    </c:when>
    <c:otherwise>
        <div class="weui-msg">
            <div class="weui-msg__icon-area">
                <i class="weui-icon-warn weui-icon_msg"></i>
            </div>

            <div class="weui-msg__text-area">
                <h2 class="weui-msg__title">暂无举报</h2>

                <p class="weui-msg__desc">您尚未举报</p>
            </div>
        </div>
    </c:otherwise>
</c:choose>

<script type="text/javascript">
    // 全局服务器路径
    var globalBasePath = "<%=basePath%>";
</script>

<script type="text/javascript" src="<%=basePath%>js/lib/ace/components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/juicer/juicer.js"></script>
<script type="text/javascript" src="<%=basePath%>js/common/utils.js"></script>
<script type="text/javascript" src="<%=basePath%>js/common/jquery.utils.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jsp/weixin/report/list.js"></script>

<!--[Juicer 模版]-->
<!--[举报模版]-->
<script id="report_list_tpl" type="text/html">
    {@each reportList as report, index}
    <a class="weui-cell weui-cell_access" href="<%=basePath%>weixin/report/detail.html?id=$J{report.id}">
        <div class="weui-cell__bd">
            <p class="f-s-16 text-break">$J{report.reportName}</p>

            <p class="c-tint-black p-t-10 f-s-14 text-no-break">$J{report.reportCreateTime}</p>
        </div>

        <div class="weui-cell__ft text-no-break">
            {@if report.reportResult == '1'}
            <span class="c-tint-black f-s-14">已举报</span>
            {@else if report.reportResult == '2'}
            <span class="c-blue f-s-14">核实中</span>
            {@else if report.reportResult == '3'}
            <span class="c-yellow f-s-14 ">已核实</span>
            {@else if report.reportResult == '4'}
            <span class="c-red f-s-14">已关闭</span>
            {@else if report.reportResult == '5'}
            <span class="c-green f-s-14">已发放</span>
            {@/if}
        </div>
    </a>
    {@/each}
</script>
<!--[/举报模版]-->
<!--[/Juicer 模版]-->
</body>
</html>